package com.ysstech.valuation.thread;

import java.util.Date;
import java.util.concurrent.Callable;

import com.ysstech.common.util.DateUtil;
import com.ysstech.valuation.entity.Valuation;
import com.ysstech.valuation.service.ValuationService;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.formula.functions.T;

@Slf4j
public class ValuationThread implements Callable<T> {
    private Valuation valuation;
    private ValuationService valuationService;

    public ValuationThread(ValuationService valuationService, Valuation valuation) {
        this.valuationService = valuationService;
        this.valuation = valuation;
    }

    @Override
    public T call() throws Exception {
        log.info(DateUtil.dateToStrByFormat(new Date(), "yyyy-MM-dd HH:mm:ss:SSS") + valuation.getAccountId());
        valuationService.produceValuation(valuation);
        return null;
    }
}
